#include "app.h"
#include "hek1008.h"
#include <string.h>
#include "hek1016.h"

/**
 * @brief CAN0接收函数，该函数不要放入循环
 * [param in] data 结构体数据
 */
void app_can0_rx(CAN_DATA_FORMAT_T data)
{
    hek1008_can0_rx_01(data);
    hek1008_can0_rx_02(data);
    hek1008_can0_rx_03(data);
    hek1008_can0_rx_04(data);

    hek1016_can0_rx(data,0);
    hek1016_can0_rx(data,1);
    hek1016_can0_rx(data,2);
    hek1016_can0_rx(data,3);
}

void hem_can1_rx_01(CAN_DATA_FORMAT_T data)
{
    uint8_t buf[8] = { 0 };

    if(data.id != 0x18FF89E0) return;
    if((data.rx_len > 8) || (data.rx_len == 0)) return;

    memcpy(buf,data.rx_data,data.rx_len);
}

/**
 * @brief CAN1接收函数，该函数不要放入循环
 * [param in] data 结构体数据
 */
void app_can1_rx(CAN_DATA_FORMAT_T data)
{
    hem_can1_rx_01(data);
}



